<?php

use think\cache\driver\Redis;
use think\Db;

$list = Db::query("SELECT SUM(order_price) as p,FROM_UNIXTIME(create_time,'%m') AS mm ,FROM_UNIXTIME(create_time,'%Y') AS yy FROM `yoshop_orders` where `pay_status` = 2 GROUP BY mm ORDER by mm asc");
        
$list = json_encode($list);
$redis = new Redis();
        
$redis->set('finance',$list);